import javax.swing.JPanel;
import javax.swing.SpringLayout;
import javax.swing.JLabel;
import java.awt.Font;

//import javax.swing.ComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class AppointmentPanel extends JPanel {
	private JTextField textField;

	private JTextField textField_1;
	
	private String[]month ={"January", "Febuary", "March",
			"April", "May", "June", "July", "August", 
			"September", "October", "November", "December"};
	
	private String[]day ={"1", "2", "3", "4", "5", "6", "7", "8", "9", 
			"10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
			"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", 
			"30", "31"};
	
	public AppointmentPanel() {
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
		
		JLabel label = new JLabel("Add an Appointment:");
		springLayout.putConstraint(SpringLayout.NORTH, 
				label, 10, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, 
				label, 130, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, 
				label, 314, SpringLayout.WEST, this);
		label.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 16));
		add(label);
		
		JLabel lblNewLabel = new JLabel("Month:");
		add(lblNewLabel);
		
		JLabel label_1 = new JLabel("Date:");
		springLayout.putConstraint(SpringLayout.NORTH, 
				label_1, -3, SpringLayout.NORTH, lblNewLabel);
		springLayout.putConstraint(SpringLayout.WEST,
				label_1, 71, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST,
				label_1, -6, SpringLayout.WEST, lblNewLabel);
		label_1.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 16));
		add(label_1);
		
		JComboBox comboBox = new JComboBox(month);
		springLayout.putConstraint(SpringLayout.NORTH, 
				comboBox, 53, SpringLayout.SOUTH, label);
		springLayout.putConstraint(SpringLayout.NORTH, 
				lblNewLabel, 4, SpringLayout.NORTH, comboBox);
		springLayout.putConstraint(SpringLayout.EAST, 
				lblNewLabel, -6, SpringLayout.WEST, comboBox);
		add(comboBox);
		
		JLabel lblNewLabel_1 = new JLabel("Day:");
		springLayout.putConstraint(SpringLayout.NORTH, 
				lblNewLabel_1, 57, SpringLayout.SOUTH, label);
		springLayout.putConstraint(SpringLayout.EAST, 
				comboBox, -20, SpringLayout.WEST, lblNewLabel_1);
		add(lblNewLabel_1);
		
		JComboBox comboBox_1 = new JComboBox(day);
		springLayout.putConstraint(SpringLayout.NORTH, 
				comboBox_1, 53, SpringLayout.SOUTH, label);
		springLayout.putConstraint(SpringLayout.WEST,
				comboBox_1, 305, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST,
				comboBox_1, -120, SpringLayout.EAST, this);
		springLayout.putConstraint(SpringLayout.EAST,
				lblNewLabel_1, -6, SpringLayout.WEST, comboBox_1);
		add(comboBox_1);
		
		JLabel label_3 = new JLabel("Time:");
		springLayout.putConstraint(SpringLayout.WEST, 
				label_3, 93, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, 
				label_3, -102, SpringLayout.EAST, comboBox);
		label_3.setFont(new Font("Tahoma", 
				Font.BOLD | Font.ITALIC, 16));
		add(label_3);
		
		textField = new JTextField();
		springLayout.putConstraint(SpringLayout.WEST, 
				textField, 0, SpringLayout.WEST, label_1);
		add(textField);
		textField.setColumns(10);
		
		JLabel label_4 = new JLabel("Reason:");
		springLayout.putConstraint(SpringLayout.WEST, 
				label_4, 28, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST,
				label_4, -382, SpringLayout.EAST, this);
		label_4.setFont(new Font("Tahoma",
				Font.BOLD | Font.ITALIC, 16));
		add(label_4);
		
		JTextArea textArea = new JTextArea();
		springLayout.putConstraint(SpringLayout.NORTH, 
				textArea, 230, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.SOUTH,
				label_4, -6, SpringLayout.NORTH, textArea);
		springLayout.putConstraint(SpringLayout.WEST, 
				textArea, 38, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, 
				textArea, -66, SpringLayout.EAST, this);
		add(textArea);
		
		JButton btnAddAppointment = new JButton("Add Appointment");
		springLayout.putConstraint(SpringLayout.WEST, 
				comboBox, 0, SpringLayout.WEST, btnAddAppointment);
		btnAddAppointment.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		springLayout.putConstraint(SpringLayout.SOUTH, 
				textArea, -74, SpringLayout.NORTH, btnAddAppointment);
		springLayout.putConstraint(SpringLayout.SOUTH, 
				btnAddAppointment, -39, SpringLayout.SOUTH, this);
		springLayout.putConstraint(SpringLayout.EAST, 
				btnAddAppointment, 0, SpringLayout.EAST, label);
		add(btnAddAppointment);
		
		JLabel label_5 = new JLabel("Preferred Doctor:");
		springLayout.putConstraint(SpringLayout.NORTH,
				label_3, 0, SpringLayout.NORTH, label_5);
		springLayout.putConstraint(SpringLayout.WEST,
				label_5, 294, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST,
				label_5, -43, SpringLayout.EAST, this);
		label_5.setFont(new Font("Tahoma", 
				Font.BOLD | Font.ITALIC, 16));
		add(label_5);
		
		textField_1 = new JTextField();
		springLayout.putConstraint(SpringLayout.NORTH, 
				textField, 0, SpringLayout.NORTH, textField_1);
		springLayout.putConstraint(SpringLayout.NORTH, 
				textField_1, 164, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, 
				textField_1, 304, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, 
				label_5, -3, SpringLayout.NORTH, textField_1);
		add(textField_1);
		textField_1.setColumns(10);
	}
}
